<?php

use think\Route;

//Route::rule('路由规则','路由地址','请求类型','路由参数（数组）','变量规则（数组）');

Route::pattern([
    'id' => '\d+',
    'column_id' => '\d+',
    'page' => '\d+',
    'limit' => '\d+',
]);

/*文章*/
Route::group('article', function () {
    Route::get('/$', 'index/Article/index');
    Route::get('/page/:page/limit/:limit/column_id/[:column_id]', 'index/Article/index');
    Route::get('/column/:column_id$', 'index/Article/index');
    Route::get('/read/:id$', 'index/Article/detail');
    Route::get('/read/:id/page/:page/limit/:limit$', 'index/Article/detail');
}, ['ext' => 'html']);

/*搜索路由*/
Route::group('search', function () {
    Route::get('/$', 'index/Search/index');
    Route::get('/search_name/[:search_name]$', 'index/Search/index');
    Route::get('/page/:page/limit/:limit/search_name/[:search_name]$', 'index/Search/index');
}, ['ext' => 'html']);

/*关于*/
Route::get('/about$','index/About/index',['ext'=>'html']);

/*项目*/
Route::group('works', function () {
    Route::get('/$', 'index/Works/index');
    Route::get('/page/:page/limit/:limit/column_id/[:column_id]', 'index/Works/index');
    Route::get('/column/:column_id$', 'index/Works/index');
    Route::get('/read/:id$', 'index/Works/detail');
}, ['ext' => 'html']);

/*微语*/
Route::group('mood', function () {
    Route::get('/$', 'index/Mood/index');
    Route::get('/page/:page/limit/:limit$', 'index/Mood/index');
    Route::get('/read/:id/page/:page/limit/:limit$', 'index/Mood/detail');
    Route::get('/read/:id$', 'index/Mood/detail');
}, ['ext' => 'html']);

/*留言*/
Route::group('message', function () {
    Route::get('/$', 'index/Message/index');
    Route::get('/page/:page/limit/:limit$', 'index/Message/index');
    Route::get('/page/:page/limit/:limit/message_id/:message_id/message_type/:message_type$', 'index/Message/index');
    Route::get('/read/:id$', 'index/Message/detail');
}, ['ext' => 'html']);